/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Kelompok 3
 */
@Entity
@Table(name = "history_payments", catalog = "onick", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HistoryPayment.findAll", query = "SELECT h FROM HistoryPayment h"),
    @NamedQuery(name = "HistoryPayment.findByIdPayment", query = "SELECT h FROM HistoryPayment h WHERE h.idPayment = :idPayment"),
    @NamedQuery(name = "HistoryPayment.findByNamaPayer", query = "SELECT h FROM HistoryPayment h WHERE h.namaPayer = :namaPayer"),
    @NamedQuery(name = "HistoryPayment.findByEmailPayer", query = "SELECT h FROM HistoryPayment h WHERE h.emailPayer = :emailPayer"),
    @NamedQuery(name = "HistoryPayment.findByTanggalPayment", query = "SELECT h FROM HistoryPayment h WHERE h.tanggalPayment = :tanggalPayment"),
    @NamedQuery(name = "HistoryPayment.findByJumlahTiket", query = "SELECT h FROM HistoryPayment h WHERE h.jumlahTiket = :jumlahTiket"),
    @NamedQuery(name = "HistoryPayment.findByTotalPayment", query = "SELECT h FROM HistoryPayment h WHERE h.totalPayment = :totalPayment")})
public class HistoryPayment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_PAYMENT", nullable = false)
    private Integer idPayment;
    @Column(name = "NAMA_PAYER", length = 100)
    private String namaPayer;
    @Column(name = "EMAIL_PAYER", length = 100)
    private String emailPayer;
    @Column(name = "TANGGAL_PAYMENT", length = 20)
    private String tanggalPayment;
    @Column(name = "JUMLAH_TIKET")
    private Integer jumlahTiket;
    @Column(name = "TOTAL_PAYMENT")
    private Integer totalPayment;
    @JoinColumn(name = "ID_EVENT", referencedColumnName = "ID_EVENT")
    @ManyToOne(fetch = FetchType.LAZY)
    private Event idEvent;

    public HistoryPayment() {
    }

    public HistoryPayment(Integer idPayment) {
        this.idPayment = idPayment;
    }

    public Integer getIdPayment() {
        return idPayment;
    }

    public void setIdPayment(Integer idPayment) {
        this.idPayment = idPayment;
    }

    public String getNamaPayer() {
        return namaPayer;
    }

    public void setNamaPayer(String namaPayer) {
        this.namaPayer = namaPayer;
    }

    public String getEmailPayer() {
        return emailPayer;
    }

    public void setEmailPayer(String emailPayer) {
        this.emailPayer = emailPayer;
    }

    public String getTanggalPayment() {
        return tanggalPayment;
    }

    public void setTanggalPayment(String tanggalPayment) {
        this.tanggalPayment = tanggalPayment;
    }

    public Integer getJumlahTiket() {
        return jumlahTiket;
    }

    public void setJumlahTiket(Integer jumlahTiket) {
        this.jumlahTiket = jumlahTiket;
    }

    public Integer getTotalPayment() {
        return totalPayment;
    }

    public void setTotalPayment(Integer totalPayment) {
        this.totalPayment = totalPayment;
    }

    public Event getIdEvent() {
        return idEvent;
    }

    public void setIdEvent(Event idEvent) {
        this.idEvent = idEvent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPayment != null ? idPayment.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistoryPayment)) {
            return false;
        }
        HistoryPayment other = (HistoryPayment) object;
        if ((this.idPayment == null && other.idPayment != null) || (this.idPayment != null && !this.idPayment.equals(other.idPayment))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.HistoryPayment[ idPayment=" + idPayment + " ]";
    }
    
}
